package cn.iocoder.yudao.module.gpt.api;

import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.module.gpt.api.dto.GPTSessionResponseDTO;
import cn.iocoder.yudao.module.gpt.api.dto.GPTUserMessageDTO;
import cn.iocoder.yudao.module.gpt.enums.ApiConstants;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import javax.validation.Valid;
import javax.validation.constraints.NotNull;

@FeignClient(name = ApiConstants.NAME) // TODO 芋艿：fallbackFactory =
@Tag(name =  "RPC 服务 - 请求对话")
public interface ChatApi {
    String PREFIX = ApiConstants.PREFIX + "/answer";
    @PostMapping(PREFIX + "/ask")
    @Operation(summary = "发送用户提问")
    CommonResult<String> ask(@Valid @RequestBody GPTUserMessageDTO gptUserMessageDTO);

    @PostMapping(PREFIX + "/request")
    @Operation(summary = "发起一次新的会话请求")
    CommonResult<GPTSessionResponseDTO> requestSessionId(@NotNull Long userId,String sessionId);
}
